package com.svse.designPattern.singleresponsibilityprinciple;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/7/25 16:16
 */
public class SingleResponsibility3 {

    public static void main(String[] args) {
        VehicleRun vehicleRun = new VehicleRun();
        vehicleRun.airRun("飞机");
        vehicleRun.roadRun("跑车");
        vehicleRun.waterRun("游艇");
    }
}

/**
 * 交通工具跑类中  不同的方法
 * 方法层面的单一
 */

class VehicleRun{
    void roadRun(String vehicle){
        System.out.println(vehicle+"在路上跑");
    }
    void airRun(String vehicle){
        System.out.println(vehicle+"在天上跑");
    }
    void waterRun(String vehicle){
        System.out.println(vehicle+"在水上跑");
    }
}
